home *** CD-ROM | disk | FTP | other *** search
- #include "ExternalInterface.h"
-
- static ExternalCallbackBlock *callbacks;
-
- pascal void PrepareCallbacks(ExternalCallbackBlock *call_backs)
- {
- callbacks = call_backs;
- }
-
- pascal Handle GetWindowContents(WindowPtr w)
- {
- return callbacks->GetWindowContents(w);
- }
-
- pascal void GetSelection(long *selStart, long *selEnd, long *firstChar)
- {
- callbacks->GetSelection(selStart, selEnd, firstChar);
- }
-
- pascal void SetSelection(long selStart, long selEnd, long firstChar)
- {
- callbacks->SetSelection(selStart, selEnd, firstChar);
- }
-
- pascal void GetDocInfo(WindowPtr w, Str255 fName, short *vRefNum, long *dirID)
- {
- callbacks->GetDocInfo(w, fName, vRefNum, dirID);
- }
-
- pascal long GetModDate(WindowPtr w)
- {
- return callbacks->GetModDate(w);
- }
-
- pascal Handle CopyText(void)
- {
- return callbacks->Copy();
- }
-
- pascal void PasteText(Handle pasteText)
- {
- callbacks->Paste(pasteText);
- }
-
- pascal long GetLastLine(void)
- {
- return callbacks->GetLastLine();
- }
-
- pascal long GetLineNumber(long selection)
- {
- return callbacks->GetLineNumber(selection);
- }
-
- pascal long GetLineStart(long selection)
- {
- return callbacks->GetLineStart(selection);
- }
-
- pascal long GetLineEnd(long selection)
- {
- return callbacks->GetLineEnd(selection);
- }
-
- pascal long GetLinePos(long line)
- {
- return callbacks->GetLinePos(line);
- }
-
-
- pascal void InsertText(char *text, long len)
- {
- callbacks->Insert(text, len);
- }
-
- pascal void DeleteText(void)
- {
- callbacks->Delete();
- }
-
-
- /* Getting and Setting window text */
- pascal void SetWindowContents(WindowPtr w, Handle h)
- {
- callbacks->SetWindowContents(w, h);
- }
-
- pascal void ContentsChanged(WindowPtr w)
- {
- callbacks->ContentsChanged(w);
- }
-
-
- /* Reading file text */
- pascal Handle GetFileText(short vRefNum, long dirID, Str255 fName, Boolean *canDispose)
- {
- return callbacks->GetFileText(vRefNum, dirID, fName, canDispose);
- }
-
-
- /* Direct user-interface calls */
- pascal Boolean GetFolder(Str255 prompt, short *vRefNum, long *dirID)
- {
- return callbacks->GetFolder(prompt, vRefNum, dirID);
- }
-
- pascal Boolean OpenSeveral(Boolean sort, short *file_count, StandardFileReply ***files)
- {
- return callbacks->OpenSeveral(sort, file_count, files);
- }
-
-
- pascal DialogPtr CenterDialog(short dialogID)
- {
- return callbacks->CenterDialog(dialogID);
- }
-
- pascal Boolean StandardFilter(DialogPtr d, EventRecord *event, short *item)
- {
- return callbacks->StandardFilter(d, event, item);
- }
-
- pascal void FrameDialogItem(DialogPtr d, short item)
- {
- callbacks->FrameDialogItem(d, item);
- }
-
-
- pascal WindowPtr NewDocument(void)
- {
- return callbacks->NewDocument();
- }
-
- pascal WindowPtr OpenDocument(void)
- {
- return callbacks->OpenDocument();
- }
-
-
- /* Utility Routines */
- pascal Handle AllocateMemory(long size, Boolean clear)
- {
- return callbacks->Allocate(size, clear);
- }
-
- pascal long FindPattern(char *text, long text_len, long text_offset,
- char *pat, long pat_len,
- Boolean case_sensitive)
- {
- return callbacks->FindPattern(text, text_len, text_offset, pat, pat_len, case_sensitive);
- }
-
-
- pascal void ReportOSError(short code)
- {
- callbacks->ReportOSError(code);
- }
-
-
- /* Preference routines */
- pascal void GetPreference(ResType prefType, short req_len, void *buffer, short *act_len)
- {
- callbacks->GetPreference(prefType, req_len, buffer, act_len);
- }
-
- pascal void SetPreference(ResType prefType, short req_len, void *buffer, short *act_len)
- {
- callbacks->SetPreference(prefType, req_len, buffer, act_len);
- }
-
-
- /* Progress routines */
- pascal void StartProgress(Str255 str, long total, Boolean cancel_allowed)
- {
- callbacks->StartProgress(str, total, cancel_allowed);
- }
-
- pascal Boolean DoProgress(long done)
- {
- return callbacks->DoProgress(done);
- }
-
- pascal void DoneProgress(void)
- {
- callbacks->DoneProgress();
- }
-
- pascal Boolean GetProjectList(FSSpec *spec, short *kind, short *count, ProjectEntry ***entries)
- {
- return callbacks->GetProjectList(spec, kind, count, entries);
- }
-
- pascal Boolean ProjectTextList(FSSpec *spec, Handle *text)
- {
- return callbacks->ProjectTextList(spec, text);
- }
-